package scientistengineer.blogspot.affrpor;

import android.app.Activity;
import android.os.Bundle;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;
import android.widget.TextView;
import android.view.View;

public class Grammar extends Activity {
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		
		super.onCreate(savedInstanceState);
		setContentView(R.layout.grammar_menu);
	
		ListView listViewMenu = (ListView) findViewById(R.id.grammarMenuListView2);
		
		RowIconText [] row_data = new RowIconText[]
				{
					new RowIconText(R.drawable.grammar, "Grammar 1"),
					new RowIconText(R.drawable.grammar, "Grammar 2"),
					new RowIconText(R.drawable.grammar, "Grammar 3"),
					new RowIconText(R.drawable.grammar, "Grammar 4"),
					new RowIconText(R.drawable.grammar, "Grammar 5")
				};

		//MenuListIconTitle grammarMenu = new MenuListIconTitle(Grammar.this, row_data, listViewMenu); 
		IconTextAdapter adapter = new IconTextAdapter(this, R.layout.listview_icon_text, row_data);
		listViewMenu.setAdapter(adapter);
		listViewMenu.setOnItemClickListener(new OnItemClickListener()
		{
			@Override
			public void onItemClick(AdapterView<?> parent, View view,
					int position, long id) {
					
				/*
					try {
						Intent launchActivity = new Intent(context, Class.forName(row_data[position].getTextView()+".class"));
						startActivity(launchActivity);
					} catch (ClassNotFoundException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}*/
				
			}
		});
	}
	
	

}
